﻿ $(function () {
    $(".soloNumeros").keypress(function (event) {
        return SoloNumeros(event);
    });

});


function popupwindow(url, title, w, h) {
    var left = (screen.width / 2) - (w / 2);
    var top = (screen.height / 2) - (h / 2);

    var argsVariable = new Object();

    return window.showModalDialog(url, argsVariable, "dialogWidth:" + w + "px; " +
    "status: no;" +
    "dialogHeight:" + h + "px; center:yes; dialogLeft:" + left + ";dialogTop:" + top);

    //return window.open(url, title, 'toolbar=no, location=no, directories=no, status=no, menubar=no, scrollbars=no, resizable=no, copyhistory=no, width=' + w + ', height=' + h + ', top=' + top + ', left=' + left);
}

function ConfirmarElim() {
    var wResult;
    wResult = confirm("¿Está seguro que desea Eliminar?");
    return wResult;
}


function FormatoGrillasSeleccionables() {
    // Dar formato a las grillas de tipo selección
    $('.selectableGridView tr').not(':has(th)').mouseover(function () {
        $(this).addClass('SelectableGridViewHighlightRow');
    }).mouseout(function () {
        $(this).removeClass('SelectableGridViewHighlightRow');
    });
    $('.selectableGridView tr:odd').not(':has(th) .paginadorGrilla').addClass('SelectableGridViewAlternateRow');
    $('.selectableGridView tr:even').not(':has(th) .paginadorGrilla').addClass('SelectableGridViewRow');    

}

function SoloNumeros(evt) {
    var caracter = (evt.which) ? evt.which : event.keyCode;
    return ((caracter > 47 && caracter < 58) || caracter == 8 || caracter == 9 || caracter == 44 || caracter == 46);
}

function CerrarPagina() {
    window.close();
}
